CC=g++
CFLAGS=-I. -static

ODIR=obj

LIBS=-lboost_system -lboost_thread -lpthread -ljansson

_DEPS = main.h connection.h server.h json.h
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))

_OBJ = main.o connection.o server.o json.o
OBJ = $(patsubst %,%,$(_OBJ))


$(ODIR)/%.o: %.c $(DEPS)
	$(CC) -c -o $@ $< $(CFLAGS)

api-server: $(OBJ)
	g++ -o $@ $^ $(CFLAGS) $(LIBS)

.PHONY: clean

clean:
	rm -f *.o *~ core $(INCDIR)/*~ 